helloApp.config(function($stateProvider) {

    $stateProvider.state('root.admin.users.details', {
        url: "/user/detail/:id",
        views: {
            "usersView@root.admin.users": {
                templateUrl : "/app/private/user/view/user_details.html",
                controller: "UserDetailsCtrl"
            },
            "hobbiesView@root.admin.users.details": {
                 templateUrl: "/app/private/hobby/view/hobbies.html",
                 controller: "HobbiesCtrl"
            }
        }
    })
});

helloApp.controller('UserDetailsCtrl', function ($scope, $http, $state, $stateParams, UserService) {

	UserService.getById($stateParams.id, function(data) {
		$scope.user = data;
	});

	$scope.deleteUser = function(user){

		UserService.delete(user.id, function(data) {
			$state.go('root.admin.users', null, {reload:true});
		});
	}
});